
package com.joysuch.wwyt.edu.enums;

/**
 * 提醒对象类型
 *
 * @author eric
 */
public enum CertificateNotifyObjType {

    /**
     * 人员
     */
    REN_YUAN(0, "人员"),
    /**
     * 部门负责人
     */
    BU_MEN_FU_ZE_REN(1, "部门负责人"),
    /**
     * 管理类型
     */
    GUAN_LI_LEI_XING(2, "管理类型")
    ;

    private int id;
    private String name;

    private CertificateNotifyObjType(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static CertificateNotifyObjType findByName(String name) {
        CertificateNotifyObjType[] values = CertificateNotifyObjType.values();
        for (CertificateNotifyObjType v : values) {
            if (v.getName().equals(name)) {
                return v;
            }
        }
        return null;
    }

    public static CertificateNotifyObjType findById(Integer level) {
        CertificateNotifyObjType[] values = CertificateNotifyObjType.values();
        for (CertificateNotifyObjType v : values) {
            if (v.getId() == level) {
                return v;
            }
        }
        return null;
    }

    public static String findNameById(Integer id) {
        if (id == null) {
            return null;
        }
        CertificateNotifyObjType[] values = CertificateNotifyObjType.values();
        for (CertificateNotifyObjType v : values) {
            if (v.getId() == id) {
                return v.getName();
            }
        }
        return null;
    }
}
